﻿
@{
    ViewData["Title"] = "CategoryInfoEdit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section head{
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet" />
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />
    <link href="/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet" />
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet" />
    <link href="/css/font-zenicon.css" rel="stylesheet" />
    <link rel="stylesheet" href="/css/smartMenu.css" type="text/css" />
    <style type="text/css">
        .tab {
            width: 100%;
        }

        .dImg {
            display: block;
            border: 1px solid #ddd;
            float: left;
            width: 151px;
            height: 145px;
            text-align: center;
            vertical-align: middle;
            margin-left: 10px;
            margin-right: 15px;
            padding: 5px;
            margin-bottom: 15px;
            margin-top: 15px;
            cursor: pointer;
        }

            .dImg p {
                text-align: center;
                margin-top: 5px;
                margin-bottom: 5px;
            }

            .dImg img {
                max-width: 150px;
                max-height: 110px;
                margin: 0 auto;
            }

        .imgChecked {
            background-color: #aaa;
            border: 1px solid #ddd;
        }

        .aTr {
            width: 20px;
            height: 20px;
            line-height: 20px;
            padding: 0px;
            margin: 0px;
        }

        #dSearch .form-control {
            display: inline;
            margin-bottom: 5px;
        }

        #tab tbody tr td {
            padding: 0px;
            position: relative;
        }

            #tab tbody tr td .form-control {
                margin: 0 !important;
                border: 2px solid #fff;
                background-color: transparent;
               /*height: 80px;*/
            }

        a:focus, a:hover {
            text-decoration: none;
        }

        #tabDir tbody a, #tabImg tbody a {
            display: block;
        }

        input[type=checkbox].cboxSel {
            margin: 0px;
        }

        #tabDir tbody tr td a {
            display: block;
        }

        #tabImg tr {
            cursor: pointer;
        }

        #tabImg tbody tr td {
            cursor: pointer;
        }

        .panel-actions .btn-sm {
            float: right;
            margin-top: -6px;
            margin-left: 5px;
        }

        .wrapper {
            padding-left: 5px;
            padding-right: 0px;
        }

        .table tr.selected td {
            background-color: #DFF0D8;
            border-color: #d6e9c6;
            color: #3c763d;
        }

        #dPlan {
            position: absolute;
            top: 5px;
            z-index: 3;
        }

            #dPlan table {
                border: 1px solid #000;
                table-layout: fixed;
            }

                #dPlan table thead th, #dPlan table tbody td {
                    border: 2px solid #000;
                    font-size: 40px;
                    min-height: 177px;
                    line-height: 80px;
                    padding: 2px;
                    word-break: break-all;
                    word-wrap: break-word;
                }

                #dPlan table thead th {
                    border-bottom: 2px solid #000;
                    height: 236px;
                    text-align: center;
                }

        .checkbox, .radio {
            margin-top: 0px;
            margin-bottom: 0px;
        }

        #dyz {
            position: absolute;
            bottom: 10px;
            right: 5px;
        }

        #ChangeTools {
            display: block;
            width: 13px;
            height: 50px;
            background-color: #18a689;
            position: absolute;
            top: 0px;
            right: 0px;
            z-index: 99;
            color: #fff;
            line-height: 50px;
            opacity: 1;
        }

            #ChangeTools i {
                font-size: 14qpx;
            }

            #ChangeTools:hover {
                background-color: #188771;
            }
    </style>

}

<form id="form1" runat="server">
    <div style="padding: 1px 5px 5px 5px; text-align: right;">

        @*<div class="input-group" style="width: 150px; float: left;">
            <input id="txtPageCount" type="number" class="form-control" style="height: 30px; border-color: #18a689;" />
            <span class="input-group-btn">
                <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="BuildLackPage();" style="float: left;">缺页生成</button>
            </span>
        </div>*@

        <div class="btn-group">
            <a class="btn btn-primary btn-outline btn-sm" href="Template/诉讼档案卷内目录.xls"><i class="icon-download"></i>导入模板</a>
            <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="Import()">导入</button>
            <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="Export()">导出</button>
            <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="AddTr();">添加行</button>
            <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="DelTr();">缩减行</button>
            <button class="btn btn-primary btn-outline btn-sm" type="button" onclick="AddData();">提交</button>
        </div>

    </div>
    <div id="dRight" style="overflow-y: auto; overflow-x: hidden; margin-left: 3px;">
        <table id="tab" class="table table-bordered scrolltable">
            <colgroup>
                <col style="width: 30px;" />
                <col style="width: 130px;" />
                <col style="width: 130px;" />
                <col style="width: auto;" />
                <col style="width: 100px;" />
                <col style="width: 70px;" />
                <col style="width: 100px;" />
                <col style="width: 100px;" />
            </colgroup>
            <thead>
                <tr>
                    <th>#</th>
                    <th>中文名</th>
                    <th>字段名</th>
                    <th>字段类型</th>
                    <th>字段长度</th>
                    <th>不为空</th>
                    <th>默认值</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
</form>
<script id="tpl" type="text/template">
    <tr>
        <td class="text-center">${len}</td>
        <td><input id="Text1" type="text" class="form-control"/></td>
        <td><input id="Text2" type="text" class="form-control"/></td>
        <td>
            <select name="test" class="form-control" id="qlc_zdz1">
                <option value="nvarchar">nvarchar</option>
                <option value="integer">integer</option>
                <option value="text">text</option>
                <option value="bool">bool</option>
            </select>
        </td>
        <td><input id="Text4" type="text" class="form-control"/></td>
        <td align="center"><input id="Text5" type="checkbox" class="text-center" /></td>
        <td><input id="Text6" type="text" class="form-control text-center"/></td>
        <td><input id="Text7" type="text" class="form-control"/></td>
    </tr>
</script>
@section scripts{
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.6"></script>

    <script src="/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-export.js"></script>
    <script src="/js/plugins/bootstrap-table/tableExport.js"></script>
    <script src="/js/plugins/bootstrap-table/bootstrap-table-cookie.js"></script>

    <script src="/js/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/plugins/layer/layer.min.js"></script>
    <script src="/js/plugins/iCheck/icheck.min.js"></script>
    <script src="/js/store.js"></script>
    <script src="/js/jquery-smartMenu.js"></script>
    <script src="/js/plug-ImgShow/jquery.js"></script>
    <script src="/js/plug-ImgShow/jqueryui.js"></script>
    <script src="/js/plug-ImgShow/jquery.mousewheel.min.js"></script>
    <script src="/js/plug-ImgShow/jquery.iviewer2.js"></script>
    <link href="/js/plug-ImgShow/jquery.iviewer.css" rel="stylesheet" />
    <script src="/js/verification.js"></script>
    <script src="/js/zuiCode.js"></script>
    <script src="/js/juicer-min.js"></script>
    <script src="/js/VolumeDir.js"></script>
    <script type="text/javascript">
        $(function () {
            //var tools = document.getElementById("dImgTools");
            //tools.style.visibility = "hidden";
        });

        function ChangeToolsBtn() {
            var tools = document.getElementById("dImgTools");
            if (tools.style.visibility == "hidden") {
                tools.style.visibility = "visible";
                $("#ChangeTools i").attr("class", "fa fa-chevron-right");
            }
            else {
                tools.style.visibility = "hidden";
                $("#ChangeTools i").attr("class", "fa fa-chevron-left");
            }
        }

        if (window.navigator.userAgent.indexOf('AppleWebKit') != -1) {
        }
        else {
            showTip("你的浏览器不是极速模式请切换成极速模式!", 1);
        }

        //导入
        function Import() {
            var _FID = $(".selected a").attr("FID");

            showPage('卷内目录导入', '/scan1/SuSongdaoru.aspx?FID=' + _FID, 800, 500, true);
        }

        function Export() {
            $('#tab').tableExport({ type: 'excel', escape: 'false', fileName: '卷内目录导出数据' });

        }

        //设置快捷键
        document.onkeydown = function () {
            //焦点不在控件上的时候执行
            var keycode = window.event.keyCode;
            if (document.activeElement.className.indexOf("form-control") == -1) {
                if (keycode == '<%=HotKey2 %>') {
                    $("#btnSearch").click();//检索
                    return false;
                }
                if (keycode == '<%=HotKey1 %>') {
                    $("#btnWC").click();//完成
                    return false;
                }
            }

            if (keycode == 38) {//上
                var prev = $("#tabImg tbody tr.selected").prev();
                prev.click();
                var height = $(prev).css("height").replace("px", "");
                var len = $("#tabImg tr.selected").prevAll().length;
                if (len >= 4) {
                    var h = (len - 4) * (parseFloat(height));
                    $("#dPage").scrollTop(h);
                }
                return false;
            }
            if (keycode == 40) {//下
                var next = $("#tabImg tbody tr.selected").next();
                next.click();
                var height = $(next).css("height").replace("px", "");
                var len = $("#tabImg tbody tr.selected").prevAll().length;
                if (len >= 4) {
                    var h = (len - 4) * (parseFloat(height));
                    $("#dPage").scrollTop(h);
                }
                return false;
            }


            if (event.activeElementId != "Text1" && event.activeElementId != "Text2" && event.activeElementId != "Text3" && event.activeElementId != "Text4" && event.activeElementId != "Text5" && event.activeElementId != "Text6" && event.activeElementId != "txtPageCount" && event.activeElementId != "txtFYear" && event.activeElementId != "txtFRef") {
                if (event.keyCode == 68) {
                    DelTr();
                }
                if (event.keyCode == 65) {
                    AddTr();
                }
            }
        }
    </script>
}
